<template>
    <div class="home">
        <router-link to="/home/search">跳转到搜索页面</router-link>
        <router-link to="/home/list?id=1">新品首发</router-link>
        <router-link to="/home/list?id=2">人气推荐</router-link>
        <div class="swipe-item">
            <van-swipe class="my-swipe" :autoplay="30000" indicator-color="white">
            <van-swipe-item  v-for="item in homeInfo.banner" :key="item.id">
                <img class="banner" :src="item.image_url" alt="">
            </van-swipe-item>
           
        </van-swipe>
        </div>
        <div>
            <div v-for="item in homeInfo.newCategoryList">
                {{ item.name }}好物
                <ul>
                    <li v-for="ele in item.goodsList">
                        <img class="img" :src="ele.list_pic_url" alt="">
                    </li>
                    <li>
                        {{ item.name }}好物
                    </li>
                </ul>
            </div>
        </div>
    </div>
</template>

<script>
import {
    index
} from "@/api/home/index"
export default {
    data() {
        return {
            homeInfo:{}
        };
    },
    computed: {

    },
    created() {
        index({
            id:1
        })
        .then(res =>{
            console.log(res)
            this.homeInfo = res
        })
    },
    mounted() {

    },
    methods: {

    },
};
</script>

<style scoped lang="scss">
.home{
    .swipe-item{
        padding:0 10px;
        .banner{
            width: 100%;
        }
    }
    .img{
        width: 100px;
    }
}
</style>
